home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Shells / bsh.lzh / bsh / dir < prev    next >
Encoding:
Text File  |  1993-02-14  |  847 b   |  22 lines

  1. # dir - a really dumb directory listing program.  Has no options, only
  2. # lists the current dir.  If you interrupt dir, it will leave the cursor
  3. # turned off; see the last line of the script for how to turn it back
  4. # on.  Also, it is not very efficient, as it must Examine() each file
  5. # up to 5 times to get its information.
  6. # Dir is presented as is; no warrantee is either expressed or implied
  7. # as to it's suitability to any purpose whatsoever.  You assume all the
  8. # risk for all damage, even if caused by a defect in the software,
  9. # no matter how awful.
  10. echo -n "\33[0 p"        # turn off cursor for speed
  11. local s d t rwed i pad
  12. foreach i ( * )
  13.     if -d "$i"
  14.     s="<dir>"
  15.     else
  16.     s=-s "$i"
  17.     endif
  18.     t=-t "$i",d=-T "$i",rwed=-p "$i",pad=left("        ",8-strlen(s))
  19.     echo "$rwed  $t  $d$pad$s  $i"
  20. end
  21. echo -n "\33[ p"        # turn cursor back on
  22.